import os

basedir = os.path.dirname(__file__)
database_dir = 'sqlite:////' + os.path.join(basedir, 'data.db')
secret_string = 'cat'
mongodb_name = 'lina'


class BaseConfig(object):
    APPLICATION_ROOT="/api"
    
    SECRET_KEY = os.getenv('SECRET_KEY', secret_string)
    SQLALCHEMY_DATABASE_URI = database_dir

    IMG_FOLDER = os.path.join(basedir, 'imgs')
    

class DeveopmentConfig(BaseConfig):
    SQLALCHEMY_TRACK_MODIFICATIONS = True  # 禁止数据的修改追踪(需要消耗资源)
    
    """
    * mongodb configuration section
    """
    user = 'root'
    password = 'ws2008'
    host = '127.0.0.1'
    port = 27018
    db_name = mongodb_name

    pass


class TestConfig(BaseConfig):
    pass


class ProductionConfig(BaseConfig):
    pass


config = {
    'development': DeveopmentConfig,
    'Test': TestConfig,
    'production': ProductionConfig
}
